package com.dongdongsongcan.app.control;

import com.dongdongsongcan.app.control.bean.ShopData;
import com.dongdongsongcan.app.model.api.WebServiceApi;
import com.su.dolphin.control.BaseControl;
import com.su.dolphin.control.task.CtrlTask;
import com.su.dolphin.control.task.CtrlTask.IControlResponse;
import com.su.dolphin.control.task.CtrlTask.IControlWork;

public class FavouriteControl extends BaseControl {

    private static FavouriteControl sControl;


    public static FavouriteControl i() {
        if (sControl == null) {
            sControl = new FavouriteControl();
        }
        return sControl;
    }

    public void user_collect_del(final int shopId , IControlResponse<ShopData> response) {
        CtrlTask.submitTask(new IControlWork() {

            @Override
            public ShopData doWork() {
                ShopData data = WebServiceApi.user_collect_del(shopId);
                return data;
            }
        }, response);

    }


    public void user_collect_insert(final int shopId , IControlResponse<ShopData> response) {
        CtrlTask.submitTask(new IControlWork() {

            @Override
            public ShopData doWork() {
                ShopData data = WebServiceApi.user_collect_insert(shopId);
                return data;
            }
        }, response);

    }

    public void user_collect(IControlResponse<ShopData> response) {
        CtrlTask.submitTask(new IControlWork() {

            @Override
            public ShopData doWork() {
                ShopData data = WebServiceApi.user_collect();
                return data;
            }
        }, response);

    }

}
